package com.zs.ktsms.mapper;

import com.zs.ktsms.pojo.Address;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AddressMapper {

    /**
     * 获取分页数据
     * @param contact
     * @param offset
     * @param pageSize
     * @return
     */
    List<Address> select(@Param("contact") String contact,@Param("userName") String userName,@Param("offset") Integer offset,@Param("pageSize") Integer pageSize);

    /**
     * 获取总记录数
     * @param contact
     * @return
     */
    int count(@Param("contact") String contact,@Param("userName") String userName);

    /**
     * 添加
     * @param address
     * @return
     */
    int add(Address address);

    /**
     * 详情
     * @param id
     * @return
     */
    Address detail(Integer id);

    /**
     * 修改
     * @param address
     * @return
     */
    int update(Address address);

    /**
     * 删除
     * @param id
     * @return
     */
    int delete(Integer id);
}
